package com.yanrumiao.entity;

import cc.uncarbon.framework.crud.entity.HelioBaseEntity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.*;
import lombok.experimental.Accessors;
import lombok.experimental.SuperBuilder;
import io.swagger.v3.oas.annotations.media.Schema;
import java.io.Serial;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.math.BigDecimal;
import cc.uncarbon.framework.core.enums.YesOrNoEnum;
import cc.uncarbon.framework.core.enums.EnabledStatusEnum;


/**
 * 数据表注释
 */
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@SuperBuilder
@AllArgsConstructor
@NoArgsConstructor
@Data
@TableName(value = "user_coupon")
public class UserCouponEntity extends HelioBaseEntity<Long> {

    @Serial
    private static final long serialVersionUID = 1L;


    @Schema(description = "状态（0禁用，1正常,2已使用，3已过期")
    @TableField(value = "status")
    private EnabledStatusEnum status;

    @Schema(description = "用户id")
    @TableField(value = "user_id")
    private Long userId;

    @Schema(description = "优惠券id")
    @TableField(value = "coupon_id")
    private Long couponId;

    @Schema(description = "店铺id")
    @TableField(value = "store_id")
    private Long storeId;

    @Schema(description = "金额")
    @TableField(value = "price")
    private BigDecimal price;

    @Schema(description = "开始时间")
    @TableField(value = "start_time")
    private LocalDateTime startTime;

    @Schema(description = "结束时间")
    @TableField(value = "end_time")
    private LocalDateTime endTime;

    @Schema(description = "使用时间")
    @TableField(value = "use_time")
    private LocalDateTime useTime;

    @Schema(description = "满减券使用时需要满足的最低消费金额（分）, 对于代金券和折扣券此字段可设为0")
    @TableField(value = "min_spend")
    private Integer minSpend;

    @Schema(description = "名称")
    @TableField(value = "name")
    private String name;

    @Schema(description = "优惠券类型：0=代金券、1=折扣券、2=满减券")
    @TableField(value = "type")
    private Integer type;

}
